<#include "componentFieldItem.ftl" />


<template>
    <div class="model-form">
        <el-page-header @back="goBack" content="增加${formBean.model!}">
        </el-page-header>
        <div class="model-content">
            <${formBean.className}Form
                    v-model="form"
                    @submit="createData"
                    @cancel="goBack"
                    ref="ruleForm"
            />
        </div>
    </div>
</template>

<script setup>
    import ${formBean.className}Form from "./form.vue";
    import {ref} from "vue";
    import {useCreate} from "@/uses/useCreate";

    const form = ref({
       <#list formBean.fields as item>
         ${item.id!}: null <#sep>,
        </#list>
    })

    const ruleForm = ref(null);

    const {createData,goBack} =useCreate("${formBean.className?uncap_first}",form,ruleForm)
</script>

<style scoped>
</style>